package com.jz.community.moduleshopping.address.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jz.community.basecomm.bean.LocationInfo;
import com.jz.community.moduleshopping.R;

import java.util.List;

/**
 * Created by Tony.Fan on 2018/6/7 11:14
 */
public class SearchAddressAdapter extends BaseQuickAdapter<LocationInfo, BaseViewHolder> {

    public SearchAddressAdapter(@Nullable List<LocationInfo> data) {
        super(R.layout.location_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LocationInfo item) {
        helper.setText(R.id.location_item_text2, item.getAddress());
        helper.setText(R.id.location_item_title, item.getTitle());
        helper.getView(R.id.location_item_check).setVisibility(item.isSelected() ? View.VISIBLE : View.INVISIBLE);
    }
}
